﻿using System;
using MadMediaManager.Core.Interfaces.Domain;

namespace MadMediaManager.Core.Domain
{
    public abstract class Entity : BaseEntity<string>, IVersionable<byte[]>, IDeletable
    {
        public override bool IsTransient()
        {
            return RowVersion == null;
        }

        public virtual byte[] RowVersion { get; set; }

        public virtual string VersionToString()
        {
            return RowVersion != null ? Convert.ToBase64String(RowVersion) : string.Empty;
        }

        public virtual bool IsDeleted { get; set; }
    }
}
